import request from '../utils/request'

export const listCollections = (userId, currentPage, pageSize) => {
	return request({
		url: `/collections/${userId}?offset=${currentPage}&limit=${pageSize}`,
		method: 'GET',
	})
}

export const insertCollection = (collection) => {
	return request({
		url: `/collections`,
		method: 'POST',
		data: collection,
	})
}

export const removeCollection = (collectionId) => {
	return request({
		url: `/collections/${collectionId}`,
		method: 'DELETE',
	})
}

export const getCollectionByAnswerId = (answerId) => {
	return request({
		url: `/collections?answerId=${answerId}`,
		method: 'GET',
	})
}
